package com.adtec.base.cloud.baseservice.rbac;

import feign.Logger;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;


@SpringBootApplication(scanBasePackages = {"com.adtec.base.cloud"})
@MapperScan(basePackages = {"com.adtec.base.cloud.**.mapper"})
//@EnableAutoConfiguration(exclude = {
//        SecurityAutoConfiguration.class
//})
@EnableDiscoveryClient
@EnableFeignClients
public class BaseserviceRbacApplication {

    public static void main(String[] args) {
        SpringApplication.run(BaseserviceRbacApplication.class, args);
    }

    //配置feign日志在主服务端输出
    @Bean
    public Logger.Level feignLoggerLevel() {
        return Logger.Level.FULL;
    }


//    @Bean
//    public PasswordEncoder passwordEncoder() {
//        return new BCryptPasswordEncoder();
//    }

}
